package bite20220311;

import java.util.Scanner;

public class homework {
    public static void main(String[] args) {
        for (int i = 1000; i <= 2000; i++) {
            if ((i%4 ==0 && i%100 != 0 )||(i%400==0)){
                System.out.println(i);
            }
        }
    }
    public static void main9(String[] args) {
        for (int n = 1; n < 101; n++) {
            double sqrt_n = Math.sqrt(n);
            int i =2;
            for (;i<sqrt_n+1;i++){
                if (n%i ==0){
                    break;
                }
            }
            if (i>sqrt_n){
                System.out.println(n);
            }
        }
    }
    public static void main8(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        double sqrt_n = Math.sqrt(n);
        int i = 2;
        for (; i < sqrt_n+1; i++) {
            if (n%i == 0){
                System.out.println(n+"不是素数");
                break;
            }
        }
        if (i>sqrt_n){
            System.out.println(n+"是素数");
        }

    }
    public static void main7(String[] args) {
        Scanner in = new Scanner(System.in);
        int age = in.nextInt();
        if(age<=18){
            System.out.println("少年");
        }else if (age<=28){
            System.out.println("青年");
        }else if (age<=55){
            System.out.println("中年");
        }else{
            System.out.println("老年");
        }
    }
    public static void main6(String[] args) {
        for (int i = 0; i < 1000; i++) {
            int sum = 0;
            int tmp = i;
            do{
                int ret = tmp%10;
                sum += ret*ret*ret;
            }while((tmp /= 10)!=0);
            if (sum == i){
                System.out.println(i);
            }

        }

    }
    public static void main5(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int n = a>b?b:a;
        int GCD = 1;
        for (int i = 1; i <= n; i++) {
            if(a%i==0 && b%i==0){
                GCD = i;
            }
        }
        System.out.println(GCD);
    }
    public static void main4(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        System.out.println("偶数位");
        for (int i = 30; i >=0 ; i-=2) {
            System.out.print(num>>>i & 1);
        }
        System.out.println("\n奇数位");
        for (int i = 31; i >=0; i-=2) {
            System.out.print(num>>>i & 1);
        }
    }
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        int sum = 0;
        for (int i = 0; i < 32; i++) {
            if ((num & 1) ==1){
                sum++;
            }
            num >>>= 1;
        }
        System.out.println(sum);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        String correctPass = "1234567.WHq";
        int i =0;
        for (; i < 3; i++) {
            System.out.println("Enter your password:");
            String password = in.nextLine();
            if (password.equals(correctPass)){
                System.out.println("correct password");
                break;
            }
            System.out.println("wrong password!Enter again.\n"+"you have only "+(2-i)+" chances.");
        }
        if (i==3){
            System.out.println("Permission denied.");
        }

    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j+"*"+i+"="+(i*j)+" ");
            }
            System.out.println();
        }
        in.close();
    }
}
